package com.cloud.mkz.common.api.feign.factory;

import com.cloud.mkz.common.api.feign.ProducerClient;
import com.cloud.mkz.common.api.feign.fallback.ProducerServiceFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


/**
 * ClassName: ProducerServiceFallbackFactory 
 * @Description: Kafka消息发送
 * @author: KuangJianyu
 * @date: 2020年4月16日
 */
@Component
public class ProducerServiceFallbackFactory  implements FallbackFactory<ProducerClient> {

	@Override
	public ProducerClient create(Throwable throwable) {
		ProducerServiceFallback producerServiceFallback = new ProducerServiceFallback();
		producerServiceFallback.setCause(throwable);
		return producerServiceFallback;
	}
}
